Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Composition Support to LoRA and (IA)³ #598

Merged
merged 9 commits into from
Nov 18, 2023
Merged

Conversation

calpt
Copy link
Member

@calpt calpt commented Nov 7, 2023

Follow-up to #591.

This PR provides initial support for adapter composition in LoRA & (IA)³ modules. Currently LoRA & (IA)³ don't support composition. With this PR, the following blocks will be supported: Stack, BatchSplit, Average, Parallel

Additionally, the LoRA implementation is refactored a bit in an effort to make it cleaner.

Limitations

  • Split & Fuse compositions are not supported
  • LoRA/ (IA)³ composition is not supported for models using the LoRAMergedLinear implementation. These currently are: GPT-2, DeBERTa (v1)

TODO

  • Fix remaining errors
  • Documentation

@calpt calpt changed the title Add Composition Support to LoRA Add Composition Support to LoRA and (IA)³ Nov 7, 2023
@TimoImhof
Copy link
Contributor

TimoImhof commented Nov 8, 2023

Regarding the refactoring, I did a run with the backwards compatibility tests and they pass ✅

@calpt calpt marked this pull request as ready for review November 11, 2023 11:18
Copy link
Member

@hSterz hSterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I have just a few comments

src/adapters/methods/lora.py Show resolved Hide resolved
src/adapters/methods/lora.py Show resolved Hide resolved
src/adapters/methods/lora.py Show resolved Hide resolved
src/adapters/methods/adapter_layer_base.py Show resolved Hide resolved
@calpt calpt requested a review from hSterz November 14, 2023 19:53
@calpt calpt changed the base branch from adapters to main November 14, 2023 20:54
Copy link
Contributor

@TimoImhof TimoImhof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me; thanks for working on this! I only left some minor comments.

src/adapters/methods/adapter_layer_base.py Outdated Show resolved Hide resolved
@calpt calpt merged commit 42fff1e into adapter-hub:main Nov 18, 2023
5 checks passed
@calpt calpt deleted the dev/x-lora branch November 18, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants